<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<%=request.getContextPath()%>/statics/uimaker/css/style.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/statics/common/vendor/jquery.min.js"></script>
</head>

<body style="background:#f0f9fd;">
	<div class="lefttop"><span></span>通讯录</div>
    
    <dl class="leftmenu" id="parentMenu">
        
    </dl>
    <script>
    	var menu={
    		init:function(){
    			menu.parentMenu = $('#parentMenu');
    			
    			$.post("<%=request.getContextPath()%>/sys/user_getMenu",
    				function(data){
	    				for(var i=0;i<data.length;i++){
	    					if(data[i].pid==0){
	    						menu.parentMenu.append('<dd><div class="title"><span><img src="<%=request.getContextPath()%>/statics/uimaker/images/leftico01.png" /></span>'+ data[i].text +'</div>');
	    						menu.parentMenu.append('<ul class="menuson" id="childMenu'+ data[i].id +'"></ul></dd>');
	    					}else{
	    						$('#childMenu'+data[i].pid).append('<li><cite></cite><a href="'+ data[i].url +'" target="rightFrame">'+ data[i].text +'</a><i></i></li>');
	    					}
    					}
	    				menu.menuClick();
    			},'json');
    			
    		},
    		menuClick:function(){
    			$(".menuson li").on('click',function(){
					$(".menuson li.active").removeClass("active")
					$(this).addClass("active");
				});
    			
    			$('.title').on('click',function(){
    				var $ul = $(this).parent().next('ul');
    				$('dl').find('ul').slideUp();
    				if($ul.is(':visible')){
    					$ul.slideUp();
    				}else{
    					$ul.slideDown();
    				}
    			});
				
    		}
    	}
    	$(function(){
    		menu.init();
    	});
    	
    </script>
</body>
</html>
